package com.guldan.jaina.utils;

import com.guldan.core.utils.DateUtil;
import com.guldan.jaina.dto.organization.OrganizationDTO;
import com.guldan.mapper.db.entity.Organization;

/**
 * Created by Silas.
 * Date: 2016/11/7
 * Time: 22:34
 */
public class OrganizationDomainConvertUtils {


    public static OrganizationDTO convert(Organization entity) {
    	OrganizationDTO dto = new OrganizationDTO();
    	dto.setAreaId(entity.getAreaId());
    	dto.setBusinessDeptCode(entity.getBusinessDeptCode());
    	dto.setOrgCode(entity.getOrgCode());
    	dto.setOrgId(entity.getOrgId());
    	dto.setOrgName(entity.getOrgName());
    	dto.setOrgNameZw(entity.getOrgNameZw());
    	dto.setOrgParentId(entity.getOrgParentId());
		dto.setOrgParentCode(entity.getOrgParentCode());
    	dto.setOrgTypeCode(entity.getOrgTypeCode());
    	dto.setRemark(entity.getRemark());
    	
    	dto.setCreateTime(DateUtil.toLocaleString(entity.getCreateTime(), DateUtil.YYYY_MM_DD_HH_DD_SS));
    	dto.setCreator(entity.getCreator());
    	dto.setDelete(entity.getIsDelete());
    	dto.setDisabled(entity.getDisabled());
    	dto.setModifier(entity.getModifier());
    	dto.setModifyTime(DateUtil.toLocaleString(entity.getModifyTime(), DateUtil.YYYY_MM_DD_HH_DD_SS));
    	
        return dto;
    }


}
